let flag1 = flag2 = 0;
let ipt4 = document.querySelector('.ipt4');
//姓名选项框

//手机
$(".ipt4").change(function() {
    let $phone = $(this).val();
    var reg = /^1(3|4|5|6|7|8|9)\d{9}$/;
    if (!reg.test($phone)) {
        alert("请输入11位数字手机号")
        this.value = ""
    } else {
        flag1 = 1
    }
});
//密码
$(".ipt3").change(function() {
    let $name = $(this).val();
    var reg = /^[\w_\S]{6,20}$/;
    if (!reg.test($name)) {
        alert("请输入6位以上的密码")
        this.value = ""
    } else {
        flag2 = 1
    }
})

//短信验证
let ipt2 = document.querySelector('.ipt2')
let btn = document.querySelector('.btn')
btn.onclick = function() {
    let randoms = parseInt(Math.random() * 1000000)
    ipt2.value = randoms;
}